#include "mainwindow.h"
#include "./ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    connect(ui->actionnew, &QAction::triggered, [=]() {
        QDialog *dialog = new QDialog(this);  // 修正：QDialogx → QDialog*
        dialog->setAttribute(Qt::WA_DeleteOnClose);
        dialog->setModal(true);  // 设置为模态对话框
        dialog->resize(200, 100);
        dialog->show();  // 注意：模态对话框通常用 exec()
    });
}

MainWindow::~MainWindow()
{
    delete ui;
}
